package com.springboot.news.domain.dto;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import lombok.Data;

import javax.validation.constraints.NotNull;

@Data
public class PageableDTO<F> {
    @NotNull(message = "current不能为空")
    private Long current;

    @NotNull(message = "size不能为空")
    private Long size;

    public <T> Page<T> toPage() {
        return new Page<>(getCurrent(), getSize());
    }
}
